PresetUtils{
	*fileIsPreset{|pathArg|
/*		 if(SoundFile.new.openRead(pathArg) || PathName(pathArg).isFile.not){
		 	("PresetUtils pathArg" + pathArg).postln;
		 	^false;
		 };*/
		 if(pathArg == nil){
		 	^false;	
		 };
		 if(
		 	pathArg.split("."[0]).pop == "rpl",
		 	{^true},
		 	{^false}
		 )	 
	}

	*getSFPath{|presetPath|
		^Object.readTextArchive(presetPath).at(\sample);
	}
	
	*getPreset{|presetPath|
		^Object.readTextArchive(presetPath);
	}
	
	*createCDesc{|presetPath|
		var controlsDesc, presetObj;
		
		// old style preset
		presetObj = Object.readTextArchive(presetPath);
		
		presetObj.keysValuesDo{
			//if
		};
		
		controlsDesc = RippleControlConfig.getDefaultCDesc;
		
	}
	
	*getSoundFileFromPath{|pathArg|
	
		var isPreset, soundFilePath, preset;
		
		preset = PresetUtils.getPresetFromPresetOrAudioFilePath(pathArg);
			
		isPreset = PresetUtils.fileIsPreset(pathArg);	
		
		if(isPreset,
			{
				soundFilePath = preset.at(\sample);
			},
			{
				soundFilePath = pathArg;
			}
		);
		
		^soundFilePath;
	
	}
	
	*getPresetFromPresetOrAudioFilePath{|pathArg|
	
		var preset, isPreset;
			
		isPreset = PresetUtils.fileIsPreset(pathArg);	
		
		if(isPreset,
			{
				preset = PresetUtils.getPreset(pathArg);
			},{}
		);
		
		^preset;
	
	}

}

